<app-back-btn></app-back-btn>
<div class="page-title">
  <span class="title" *ngIf="!this.code">添加TestUnit</span>
  <span class="title" *ngIf="this.code">修改TestUnit</span>
</div>

<div class="panel panel-body">
  <form nz-form [formGroup]="validateForm" class="form-wrap" (submit)="addTestUnit($event)">
    <h2 class="subtitle">TestUnit信息</h2>

    <!--factoryCode start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="factoryCode" nzRequired> 工厂编码</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('factoryCode')">
        <input nz-input formControlName="factoryCode" type="text" id="factoryCode" placeholder="工厂编码">
        <nz-form-explain *ngIf="getFormControl('factoryCode').dirty&&getFormControl('factoryCode').errors">
          <ng-container *ngIf="getFormControl('factoryCode').hasError('required')">请输入工厂编码</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        工厂编码
      </nz-form-control>
    </nz-form-item>

    <!--sampleCode start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="sampleCode" nzRequired> 样品编码</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('sampleCode')">
        <input nz-input formControlName="sampleCode" type="text" id="sampleCode" placeholder="样品编码">
        <nz-form-explain *ngIf="getFormControl('sampleCode').dirty&&getFormControl('sampleCode').errors">
          <ng-container *ngIf="getFormControl('sampleCode').hasError('required')">请输入样品编码</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        样品编码
      </nz-form-control>
    </nz-form-item>

    <!--factorySn start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="factorySn" nzRequired> 工厂编码</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('factorySn')">
        <input nz-input formControlName="factorySn" type="text" id="factorySn" placeholder="工厂编码">
        <nz-form-explain *ngIf="getFormControl('factorySn').dirty&&getFormControl('factorySn').errors">
          <ng-container *ngIf="getFormControl('factorySn').hasError('required')">请输入工厂编码</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        工厂编码
      </nz-form-control>
    </nz-form-item>

    <!--sn start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="sn" nzRequired> 产品sn</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('sn')">
        <input nz-input formControlName="sn" type="text" id="sn" placeholder="产品sn">
        <nz-form-explain *ngIf="getFormControl('sn').dirty&&getFormControl('sn').errors">
          <ng-container *ngIf="getFormControl('sn').hasError('required')">请输入产品sn</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        产品sn
      </nz-form-control>
    </nz-form-item>

    <!--syncState start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="syncState" nzRequired>同步状态</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('syncState')">
        <input nz-input formControlName="syncState" type="text" id="syncState" placeholder="同步状态：禁止同步 Ban, 准备同步 Ready,同步中 Sync,同步错误 Error,已经同步 Synced ">
        <nz-form-explain *ngIf="getFormControl('syncState').dirty&&getFormControl('syncState').errors">
          <ng-container *ngIf="getFormControl('syncState').hasError('required')">请输入同步状态：禁止同步 Ban, 准备同步 Ready,同步中 Sync,同步错误 Error,已经同步 Synced </ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        同步状态：禁止同步 Ban, 准备同步 Ready,同步中 Sync,同步错误 Error,已经同步 Synced 
      </nz-form-control>
    </nz-form-item>

    <!--jobnumber start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="jobnumber" nzRequired> </nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('jobnumber')">
        <input nz-input formControlName="jobnumber" type="text" id="jobnumber" placeholder="">
        <nz-form-explain *ngIf="getFormControl('jobnumber').dirty&&getFormControl('jobnumber').errors">
          <ng-container *ngIf="getFormControl('jobnumber').hasError('required')">请输入</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        
      </nz-form-control>
    </nz-form-item>

    <!--staffCode start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="staffCode" nzRequired> </nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('staffCode')">
        <input nz-input formControlName="staffCode" type="text" id="staffCode" placeholder="">
        <nz-form-explain *ngIf="getFormControl('staffCode').dirty&&getFormControl('staffCode').errors">
          <ng-container *ngIf="getFormControl('staffCode').hasError('required')">请输入</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        
      </nz-form-control>
    </nz-form-item>

    <!--表单底部start-->
    <nz-form-item class="action-button">
      <nz-form-control class="text-center">
        <button nz-button nzSize="large" [nzType]="'primary'" class="pl-30 pr-30" [nzLoading]="isConfirmLoading">
          {{'Btn0009'| translate}}
        </button>
      </nz-form-control>
    </nz-form-item>
    <!--表单底部end-->
  </form>

</div>
